/*   
 * Copyright (c) 2013-2023 LanYoung tech co., LTD. All Rights Reserved.   
 *   
 * This software is the confidential and proprietary information of   
 * LanYoung tech. You shall not disclose such Confidential Information   
 * and shall use it only in accordance with the terms of the agreements   
 * you entered into with LanYoung tech.   
 *   
 */
package com.github.ldw4033.util;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;

public class ActivitiUtils {
	private static ProcessEngine processEngine;

	/**
	 * 单例模式获取引擎对象
	 */
	public static ProcessEngine getProcessEngine() {
		if (processEngine == null) {
			/*
			 * 使用默认的配置文件名称（activiti.cfg.xml）创建引擎对象
			 */
			processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault().buildProcessEngine();
		}
		return processEngine;
	}
}
